{% extends "base.html" %}
{% block content %}
<div class="container">
    <h3 class="mt-4">配置下载
        <div style="float: right;width: 500px">
            <form method="get">
                <div class="col-lg-6">
                    <div class="input-group"><input type="text" name="q" class="form-control" placeholder="请输入IP..." value={{ search_data }}>
                        <span class="input-group-btn">
                            <button
                            class="btn btn-default" type="submit">
                                <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                            </button>
                        </span>
                    </div><!-- /input-group -->
                </div><!-- /.col-lg-6 -->
            </form>
        </div>
    </h3>
    <table class="table table-bordered">
        <tr>
            <th>设备名称</th>
            <th>备份日期</th>
            <th>ip</th>
            <th>操作</th>
        </tr>
        {% for back in form %}
        <tr>
            <td>{{ back.title }}</td>
            <td>{{ back.time }}</td>
            <td>{{ back.ip }}</td>
            <td><a class="btn btn-primary btn-xs" href="/backup/download/?nid={{ back.id }}">下载</a> <a
                    class="btn btn-primary btn-xs" href="/backup/delete/?nid={{ back.id }}">删除</a></td>
        </tr>
        {% endfor %}
    </table>
    <div class="clearfix">
        <ul class="pagination" style="float:left;"> {{ page_string }}
            <li>
                <form method="get" style="float: left;margin-left: -1px">
                    <div class="input-group" style="width: 110px"><input type="text" name="page" class="form-control"
                                                                         placeholder="页码"> <span
                            class="input-group-btn">    <button type="submit" class="btn btn-default">跳转</button></span>
                    </div>
                </form>
            </li>
        </ul>
    </div>
</div>
{% endblock content %}